<template>
  <div class="permission_content">
     <el-card class="box-card">
        <div slot="header" class="card_seach">
          <h3>日报总结</h3>
          <!-- 搜索 -->
          <div class="search_box"> 
            <div class="block">
              <el-date-picker
                v-model="keyworld.date"
                align="center"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日报日期"
                :picker-options="pickerOptions"
                @change="choseDate"
                >
              </el-date-picker>
               <el-input
                  placeholder="请输入内容"
                  prefix-icon="el-icon-search"
                  v-model="keyworld.uname"
                  style="width: 250px; margin-left: 50px;"
                  >
                </el-input>

                <el-button type="primary" @click="search" style=" margin-left: 50px;">查询</el-button>
            </div>
          </div>
        </div>
          <!-- 日报列表 -->
          <Tablelist ref="dailyCheck"/>
      </el-card>
  </div>
</template>

<script>
import Tablelist from './comment/Tablelist.vue'

export default {
  name: 'permission',
  components: {Tablelist },
  data() {
    return {
      keyworld: {
        date: '',
        uname: ''
      },
      pickerOptions: {
          disabledDate(time) {
            return time.getTime() > Date.now();
          },
          shortcuts: [{
            text: '今天',
            onClick(picker) {
              picker.$emit('pick', new Date());
            }
          }, {
            text: '昨天',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24);
              picker.$emit('pick', date);
            }
          }]
        },
    }
  },
  mounted() {
    
  },
  methods: {
    search () {
      // console.log(this.keyworld);
      this.$refs.dailyCheck.searchItem(this.keyworld)
    },
    choseDate (e) {
      console.log(e);
    }
  }
}
</script>

<style lang="scss" scoped>




</style>
